//
//  WYCBaseController.m
//  WYCweibo
//
//  Created by 魏云超 on 15/11/21.
//  Copyright © 2015年 魏云超. All rights reserved.
//

#import "WYCBaseController.h"
#import "WYCOAuthController.h"
#import "WYCAccount.h"
@interface WYCBaseController ()<WYCDefaultCenterViewDelegate>

@end

@implementation WYCBaseController


-(void)loadView
{
    //1.获取授权信息
    WYCAccount *account = [WYCAccount accountFromSandbox];
    //2.判断是否授权
    if (account != nil) {
        //2.1显示tableview
        [super loadView];
    }else{
        //2.2显示默认界面
        WYCDefaultCenterView *defaultCenterView = [WYCDefaultCenterView defaultCenterView];
        defaultCenterView.delegate = self;
        self.view = defaultCenterView;
        self.defaultCenterView = defaultCenterView;
    }
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    
}
#pragma mark -WYCDefaultCenterViewDelegate

-(void)defaultCenterView:(WYCDefaultCenterView *)defaultCenterView loginButton:(UIButton *)button
{
    DDLogInfo(@"点击了登陆按钮");
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"WYCOAuthController" bundle:nil];
    UIViewController *oauthVC = sb.instantiateInitialViewController;
    [self presentViewController:oauthVC animated:YES completion:nil];
    
}
-(void)defaultCenterView:(WYCDefaultCenterView *)defaultCenterView registButton:(UIButton *)button
{
    DDLogInfo(@"点击了注册按钮");
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
    return 0;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
    return 0;
}



@end
